@use "../../vars" as *;

.user-menu {
  position: relative;

  .submenu-header {
    display: none;
  }
  .button.user-menu-toggle {
    .notification-dot ~ .avatar-wrap::after {
      content: "";
      position: absolute;
      bottom: 0;
      right: 0;
      border: 1px solid var(--background-primary);
      border-radius: 2rem;
      background: var(--text-primary-blue);
      width: 0.5rem;
      height: 0.5rem;
    }
  }

  @media screen and (max-width: $screen-md) {
    .user-menu-toggle:hover {
      --button-bg: transparent;
    }
  }

  @media screen and (min-width: $screen-md) {
    /*
      The user menu button is shaped like an avatar and thus has some
      very specific focus and hover states.
    */
    .button.user-menu-toggle {
      &:hover,
      &:focus {
        &,
        .button-wrap {
          border-color: transparent;
          background: transparent;
          box-shadow: none;
        }
      }

      &:focus {
        .avatar {
          border: 1px solid var(--button-secondary-border-focus);
          box-shadow: var(--focus-effect);
        }
      }

      &::after {
        display: none;
      }
    }

    .submenu-header {
      display: block;
      padding: 0 0 0.5rem;
      margin-bottom: 0.5rem;
    }

    .submenu-item {
      padding: 0.5rem;
    }

    .signout-container {
      margin-top: 0.5rem;
    }

    .user-menu-id {
      display: none;
    }

    .submenu {
      left: initial;
      max-width: max-content;
      right: 0;
    }
  }
}
